package org.jeecg.modules.car.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.entity.charge.ChargeInvoice;
import org.jeecg.entity.charge.ChargeInvoiceInfo;

import java.util.List;

/**
 * @Description: 票据
 * @Author: jeecg-boot
 * @Date:   2019-08-08
 * @Version: V1.0
 */
public interface ChargeInvoiceMapper extends BaseMapper<ChargeInvoice> {
    //根据对应票据编号获取票据号码
    public List<ChargeInvoice> getInvoicesByDm(@Param("invoiceDm") String invoiceDm);
    //更新对应票据
    public Integer  updateInvoices(ChargeInvoice invoice);
    //根据对应的票据号码和编号获取对应的ID
    public String  getIdByInoivce(@Param("invoiceHm") String invoiceHm, @Param("invoiceDm") String invoiceDm);
    //根据对应的票据号码和编号获取对应的票据信息
    public ChargeInvoice  getInvoiceDmHm(@Param("invoiceHm") String invoiceHm, @Param("invoiceDm") String invoiceDm);

    //根据对应票据编号获取所有票据号码包含已使用的
    public List<ChargeInvoice> getInvoicesByDmAll(@Param("invoiceDm") String invoiceDm);

    //插入退票的票据
    public Integer  insertInvoice(ChargeInvoice invoice);

    public List<ChargeInvoice> getInvoicesByDmCharged(@Param("invoiceDm") String invoiceDm, @Param("endDate") String endDate);
    /**
     * 日报表查询
     * */
    public List<ChargeInvoice>  getInvoice(ChargeInvoice invoice);

     /**票据核销修改票据表信息*/
    public Integer cancellScrap(ChargeInvoice invoice);

    /**票据作废*/
    public Integer scrap(ChargeInvoice invoice);

    /**根据ID查询票据*/
    public ChargeInvoice get(String id);

    public Integer insertInvoiceList(@Param("chargeInvoice") List<ChargeInvoice> chargeInvoice);

    public Integer insertInfos(@Param("infolist") List<ChargeInvoiceInfo> infolist);

}
